<?php
require_once("finance_commons.php");
require_once("../data/User.php");
require_once("../data/Expense.php");

checkFinanceAdminRights();

displayTop("Finance admin home",null,null);
?>
<p>This part of the application is only accessible to finance admin users.</p>
<table  cellspacing="10">
<tr>
	<td><img src="../resources/images/kspread.png"/></td>
	<td><b>Finance administrator functions</b>
	<p>
	Register or remove an expenditure.
	</p>
	</td>
	<td>
	<h2>Total: <?=Expense::getTotalExpenses(); ?> Euros</h2>
	<?php
	$l_users=User::getAll();
	if(count($l_users)!=0){
		$tableData=new TableData("ExpenseForAllUsers");
		$tableData->setRecords($l_users);
		$tableData->addHeader("fullName","Full name");
		$tableData->addHeader("totalExpense","Total expenses");
		displayTable($tableData);
	}
	?>
	</td>
</tr>
</table>
<?php
displayBottom();
?>